package com.lianyu.wangyiyun.application;

import android.app.Application;

import com.lianyu.wangyiyun.utils.HistoryHelper;
import com.lianyu.wangyiyun.utils.LoginManager;
import com.scwang.smart.refresh.footer.ClassicsFooter;

import cn.leancloud.AVOSCloud;

/**
 * @author Chen Yuguang
 */
public class MyLeanCloudApp extends Application {

    static {
        ClassicsFooter.REFRESH_FOOTER_PULLING = "上拉加载更多";
        ClassicsFooter.REFRESH_FOOTER_RELEASE = "释放立即加载";
        ClassicsFooter.REFRESH_FOOTER_REFRESHING = "正在刷新...";
        ClassicsFooter.REFRESH_FOOTER_LOADING = "正在加载...";
        ClassicsFooter.REFRESH_FOOTER_FINISH = "加载完成";
        ClassicsFooter.REFRESH_FOOTER_FAILED = "加载失败";
        ClassicsFooter.REFRESH_FOOTER_NOTHING = "没有更多数据了";
    }

    @Override
    public void onCreate() {
        super.onCreate();
        // 初始化登录信息储存库
        LoginManager.initLogin(this);
        // 初始化历史记录储存库
        HistoryHelper.initHelper(this);
        // 提供 this、App ID、App Key、Server Host 作为参数
        // 注意这里千万不要调用 cn.leancloud.core.AVOSCloud 的 initialize 方法，否则会出现 NetworkOnMainThread 等错误。
        AVOSCloud.initialize(this, "evMFdDOdH71H962uo6gegPBi-gzGzoHsz", "do4E9Gnv6QXDvdlqqJBfTXLl", "https://evmfddod.lc-cn-n1-shared.com");
    }
}